//
const authApi = 'xxx';
const commonApi = 'xxx';
const path = require('path');
// 只有以 VUE_APP_ 开头的变量会被 webpack.DefinePlugin 静态嵌入到客户端侧的包中
process.env.VUE_APP_VERSION = require('./package.json').version

module.exports = {
  // publicPath: process.env.NODE_ENV === 'production' ? '././' : '/',
  configureWebpack: {
    resolve: {
      alias: {
        'src': path.join(__dirname, './src'),
        'assets': path.join(__dirname, './src/assets'),
        'pages': path.join(__dirname, './src/views'),
        'api': path.join(__dirname, './src/api'),
        'components': path.join(__dirname, './src/components'),
        'utils': path.join(__dirname, './src/utils')
      },
    },
    externals: {
      'vue': 'Vue',
      'echarts': 'echarts',
    },
  },
  devServer: {
    // proxy: {
    //   '/api/auth': {
    //     target: authApi,
    //     changeOrigin: true,
    //     pathRewrite: { '/api/auth': '/auth' },
    //   },
    //   '/api/common': {
    //     target: commonApi,
    //     changeOrigin: true,
    //     pathRewrite: { '/api/common': '/api' },
    //   },
    // },
    host: '0.0.0.0',
    port: 8090,
    https: false,
    open: true,
  },
  lintOnSave: process.env.NODE_ENV !== 'production',
  css: {
    sourceMap: true,
  },
  productionSourceMap: false,
  runtimeCompiler: true,
  transpileDependencies: [
  ]
};
